<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>判断字符串是否包含其他字符串的方法集合</title>
  </head>
  <body>
    <script type="text/javascript">
      const strArr = ["星期一", "星期二", "星期三", "星期四", "星期五"];
      const str = "sdfsf星期一yi一防守打法";

      const isStrIncludes = (arr, str = "") => {
        arr.map((item) => {
          let flag = str.includes(item);
          if (flag) {
            console.log("包含", item);
          }
        });
      };
      isStrIncludes(strArr, str);

      WfForm.bindFieldAction(
        "onblur",
        "field6453",
        function (fieldid, rowIndex) {
          var FieldValue1 = WfForm.getBrowserShowName("field7190");
          var FieldValue2 = WfForm.getFieldValue("field6453");
          console.log(FieldValue1);
          console.log(FieldValue2);

          console.log(FieldValue2.indexOf(FieldValue1));
          const FieldValueArr=FieldValue1.split(',')
          if (FieldValue2.indexOf(FieldValue1) !== -1) {
            WfForm.showMessage(
              "【我方签约主体】不能存在于【签约相对方】中",
              2,
              4
            );
          } else if (Array.isArray(FieldValueArr) && FieldValueArr.length > 1) {
            FieldValueArr.map((item)=>{
              if(FieldValue2.indexOf(item)!== -1){
                WfForm.showMessage("【我方签约主体】不能存在于【签约相对方】中",2,4);
              }
            });
          }
        }
      );
    </script>
  </body>
</html>
